<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>人员管理-v3</title>
  <link rel="stylesheet" href="../../../node_modules/bootstrap/dist/css/bootstrap.min.css"/>
</head>
<body>

<div id="res" class="container-fluid">

  <div class="row-fluid">
    <div class="col-sm-12">
      <h3 class="page-header text-center">
        人员管理
        <small>{{modeTitle}} (Member Viewer)</small>
      </h3>
    </div>
  </div>

  <div class="row">
    <div class="col-sm-12">
      <br/>
    </div>
  </div>

  <div class="row">
    <div class="collapse col-sm-12" id="advancedsearch">
      <div class="well">
        <div class="row">
          <!-- <form class="form-horizontal contract-form"> -->
          <div class="form-group">
            <label class="col-sm-1 control-label">Begin Time</label>

            <div class="col-sm-5">
              <input id="begtime" name="begtime" type="text" v-model="begtime" value="2015-01-01" class="form-control"
                     required/>
            </div>
            <label class="col-sm-1 control-label">End Time</label>

            <div class="col-sm-5">
              <input id="endtime" name="endtime" type="text" v-model="endtime" value="2016-02-01"
                     class="form-control" required/>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-1 control-label">User Id</label>

            <div class="col-sm-5">
              <input id="user" name="user" type="text" v-model="user" value="" class="form-control" required/>
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-9 col-sm-1">
              <button class="btn btn-outline btn-block btn-warning" type="reset">清除</button>
            </div>
            <div class="col-sm-2">
              <button id='submitbutton' class="btn btn-outline btn-block btn-success save"
                      v-on:click="advancedsearch($event)">提交
              </button>
            </div>
          </div>
          <!-- </form> -->
        </div>
      </div>
    </div>
    <!-- advancedsearch -->
  </div>
  <div id="objectlist" v-show="mode=='modeList'">
    <div class="row">
      <itemsearch :item="curitem" :on-remove="onRemove" :on-add="onAdd"></itemsearch>
      <itemlist :mode="mode" :items="items" :on-remove="onRemove"></itemlist>
    </div>
  </div>
  <!--/modeAddNew-->
  <div id="objectadd" v-show="mode=='modeAddNew'">
    <div class="row">
      <itemeditor :mode="mode" :item="curitem" :on-submit="onSave" :on-cancel="onCancel"></itemeditor>
    </div>
  </div>
  <!--/modeAddNew-->
  <div id="objecteditor" v-show="mode=='modeEdit'">
    <div class="row">
      <itemeditor :mode="mode" :item="curitem" :on-submit="onSave" :on-cancel="onCancel"></itemeditor>
    </div>
  </div>
  <!--/modeEdit-->
  <div id="objectdetails" v-show="mode=='modeItemView'">
    <div class="row">
      <itemdetails :mode="mode" :item="curitem" :on-cancel="onCancel"></itemdetails>
    </div>
  </div>
  <!--/modeDetails-->
</div>
<!--/res-->

<template id="itemeditor-tpl">
  <div class="col-sm-12">
    <!--form begin-->
    <div class="form-horizontal">

      <div class="site-bgcolor">

        <div class="form-group">
          <label for="memberid" class="col-sm-2 control-label">id</label>

          <div class="col-sm-4">
            <input class="form-control" id="memberid" name="memberid" placeholder="id" readonly v-model="item.id">
          </div>
        </div>
        <div class="form-group">
          <label for="name" class="col-sm-2 control-label">name</label>

          <div class="col-sm-4">
            <input class="form-control" id="name" name="name" placeholder="name" v-model="item.name">
          </div>
        </div>
        <div class="form-group">
          <label for="birth" class="col-sm-2 control-label">birth</label>

          <div class="col-sm-4">
            <input class="form-control" id="birth" name="birth" placeholder="birth" v-model="item.birth">
          </div>
        </div>
        <div class="form-group">
          <label for="sex" class="col-sm-2 control-label">sex</label>

          <div class="col-sm-4">
            <select id="sex" v-model="item.sex">
              <option value="Male">Male</option>
              <option value="Female">Female</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label for="tel" class="col-sm-2 control-label">tel</label>

          <div class="col-sm-4">
            <input class="form-control" id="tel" name="tel" placeholder="tel" v-model="item.tel">
          </div>
        </div>

        <div class="form-group">
          <label for="email" class="col-sm-2 control-label">email</label>

          <div class="col-sm-4">
            <input class="form-control" id="email" name="email" placeholder="email" v-model="item.email"/>
          </div>
        </div>
        <div class="form-group">
          <label for="address" class="col-sm-2 control-label">address</label>

          <div class="col-sm-4">
            <input class="form-control" id="address" name="address" placeholder="address" v-model="item.address"/>
          </div>
        </div>

        <div class="form-group">
          <div class="col-sm-3 col-md-push-9">
            <button class="btn btn-default" v-on:click="onCancelClick(item,$event)">取消</button>
            <button class="btn btn-default" v-on:click="onSubmitClick(item,$event)">保存</button>
          </div>
        </div>
        <hr/>
      </div>
    </div>
    <!-- </form> -->
  </div>
</template>

<template id="itemlist-tpl" class="container-fluid">
  <div class="table-responsive col-sm-12">
    <ul class="media-list row contacts-container"></ul>
    <table class="table table-bordered table-condensed table-striped">
      <br/>
      <thead>
      <tr class="info">
        <th></th>
        <th>人员id</th>
        <th>姓名</th>
        <th>性别</th>
        <th>出生日</th>
        <th>联系电话</th>
        <th>邮箱</th>
        <th>oper</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="item in items">
        <td><input type="checkbox" v-model="item.selected"></td>
        <td><a href="#details" v-on:click="onDetails(item,'modeItemView')">{{item.id}}</a>
        </td>
        <td><a href="#details" v-on:click="onDetails(item,'modeItemView')">{{item.name}}</a>
        </td>
        <td>{{item.sex}}</td>
        <td>{{item.birth}}</td>
        <td>{{item.tel}}</td>
        <td>{{item.email}}</td>
        <td>
          <a href="#" v-on:click="onEdit(item,'modeEdit')">编辑</a>&nbsp;|
          <a href="#" v-on:click="onRemove(item)">删除</a>&nbsp;|
        </td>
      </tr>
      </tbody>
    </table>
  </div>

  <!--<div class="col-sm-12">
    注：测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本
  </div>-->
</template>
<!--itemsearch-tpl-->
<template id="itemsearch-tpl">
  <div class="col-sm-12">
    <div class="col-sm-3">
      <button class="btn btn-default" href="#add" v-on:click="onAdd()">新增</button>
      <button class="btn btn-default" v-on:click="onRemoveSelected()">删除选中记录</button>
    </div>
    <div class="col-sm-offset-3 col-sm-3">
      <input id="searchQuery" name="query" type="text" style="float:right" v-model="searchQuery" class="form-control"
             required/>
    </div>
    <div class="col-sm-2">
      <button id='search' class="btn btn-outline btn-block btn-success save" v-on:click="basicsearch($event)"><strong>搜索全部</strong>
      </button>
    </div>
    <div class="col-sm-1 text-left vertical-middle-sm">
      <h5><strong>
        <a role="button" class="control-label" data-toggle="collapse" href="#advancedsearch" aria-expanded="false"
           aria-controls="advancedsearch">高级...</a>
      </strong></h5>
    </div>
  </div>
</template>
<!--/itemsearch-tpl-->

<template id="itemdetails-tpl">
  <div class="col-sm-12">
    <br/>

    <div class="row show-grid" align="center">
      <img src="http://euvee.vicp.co/file?filename=681d84ee-2bff-437c-b304-ba7aa2e378b8.JPG&day=20160628" class="img-circle" width="150" height="150">
    </div>
    <br/>
    <br/>

    <div class="row show-grid">
      <div class="col-lg-1 col-md-offset-3" >
        <h3><strong>唯一标识：</strong></h3>
        <h3><strong>json：</strong>
        </h3>
        <h3><strong>姓名：</strong>
        </h3>
        <h3><strong>性别：</strong>
        </h3>
        <h3><strong>出生日：</strong>
        </h3>
        <h3 ><strong>联系电话：</strong>
        </h3>
        <h3><strong>通信地址：</strong>
        </h3>
        <h3><strong>邮箱：</strong>
        </h3>
      </div>
      <div class="col-lg-6" >
        <h3>{{item.id}}</h3>
        <h3>null{{item.json}}</h3>
        <h3>{{item.name}}</h3>
        <h3>{{item.sex}}</h3>
        <h3>{{item.birth}}</h3>
        <h3>{{item.tel}}</h3>
        <h3>{{item.address}}</h3>
        <h3>{{item.email}}</h3>
      </div>
<!--
      <div class="col-lg-6" >.col-lg-6</div>
-->
    </div>
    <br/>
<!--    <object style="border:0px" type="text/x-scriptlet" data="../fdb/node-v1.html" width=100% height=300></object>-->
    <div class="row show-grid">
      <div class="col-sm-3 col-md-push-9">
        <button class="btn btn-default" v-on:click="onCancelClick(item,$event)">返回</button>
      </div>
    </div>
  </div>
  <!--<iframe src="../fdb/node-v1.html" frameborder="0" width="100%"  height="800" ></iframe>-->
  <br/>
  <br/>
  <br/>
  <br/>



  <!--<div class="container-fluid">
    <div class="row-fluid">
      <div class="span4">
        <img src="http://euvee.vicp.co/file?filename=681d84ee-2bff-437c-b304-ba7aa2e378b8.JPG&day=20160628"
             class="img-circle" alt="140x140">
      </div>
      <div class="span8">
        222
      </div>
    </div>
  </div>-->
</template>
<!--/itemdetails-tpl-->

<script src="../../../../site-web/node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../../../site-web/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="../../../node_modules/vue/dist/vue.js"></script>
<script src="../../../lib/vue-resource/0.7.0/vue-resource.js"></script>
<script src="./members-v3.js"></script>
</body>
</html>
